<template>
	<!-- 钱包卡片 -->
	<view class="sh-wallet-box u-flex u-m-b-10 u-p-r-20">
		<view class="u-flex wallet-left">
			<view class="wallet-item u-flex-col u-col-center" @tap="jump('/pages/user/favorite')">
				<text class="wallet-item__detail item-score u-ellipsis-1">{{ productFavoriteCount || '0' }}</text>
				<text class="wallet-item__title">商品收藏</text>
			</view>
			<view class="wallet-item u-flex-col u-col-center" @tap="jump('/pages/user/storefavorite')">
				<text class="wallet-item__detail item-score u-ellipsis-1">{{ storeFavoriteCount || '0' }}</text>
				<text class="wallet-item__title">关注店铺</text>
			</view>
			<view class="wallet-item u-flex-col u-col-center" @tap="jump('/pages/user/wallet/score-balance')">
				<text class="wallet-item__detail   u-ellipsis-1">{{ point || '0' }}</text>
				<text class="wallet-item__title">当前积分</text>
			</view>
		</view>
		<view class="wallet-item u-flex-col wallet-right u-col-center" @tap="jump('/pages/user/wallet/index')">
			<image class="wallet-img" :src="$IMG_URL + '/imgs/user/wallet.png'" mode="aspectFill"></image>
			<text class="wallet-item__title">账户余额</text>
		</view>
	</view>
</template>

<script>
/**
 * 钱包样式卡片
 */
import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
export default {
	components: {},
	data() {
		return {
			categoryCurrent: 0 ,//分类轮播下标
			productFavoriteCount :0,
			storeFavoriteCount:0,
			point :0,
		};
	},
	mounted() {
		this.init();
	},
	onLoad(){
		this.init();
	},
	onShow(){
		this.init();
	},
	computed: {
		...mapGetters(['userInfo', 'userOtherData'])
	},
	methods: {
		jump(path, query) {
			this.$Router.push({
				path: path,
				query: query
			});
		},
		init(){
				let that = this;
					that.$http('user.apiinfo', {
						UId: uni.getStorageSync("UId")
					}).then(res => {
						 //console.info(JSON.stringify(res)+5555555)
							this.isRefresh = false;
							 this.productFavoriteCount = res.data.productFavoriteCount;
							 this.storeFavoriteCount = res.data.storeFavoriteCount;
							 this.point = res.data.HzMember.point;
					});
		
		},
	}
};
</script>

<style lang="scss">
// 钱包卡片

.sh-wallet-box {
	background: #fff;
	height: 180rpx;
 
	position: relative;
	background: url("https://image.hzwltb69.com/app/images/backorder.png") no-repeat center / 100% 100%;
	width: 700rpx;
	margin-left: 25rpx;
	border-radius: 25rpx;
	z-index: 10;
	.wallet-left {
		flex: 4;
	}
	.wallet-right {
		position: relative;
		.cut-off--line {
			position: absolute;
			top: 50%;
			transform: translateY(-50%);
			right: (750rpx/5) - 15rpx;
			width: 30rpx;
			height: 136rpx;
		}
	}
	.wallet-item {
		flex: 1;
		.wallet-img {
			width: 46rpx;
			height: 46rpx;
		}
		.wallet-item__detail {
			font-size: 28rpx;
			width: 180rpx;
			text-align: center;
			font-weight: 500;
			color: rgba(168, 112, 13, 1);
		}
		.wallet-item__title {
			font-size: 26rpx;
			font-weight: 400;
			color: rgba(153, 153, 153, 1);
			margin-top: 20rpx;
		}
		.item-balance::after {
			content: '元';
			font-size: 16rpx;
			margin-left: 4rpx;
		}
		.item-score::after {
			content: '个';
			font-size: 14rpx;
			margin-left: 4rpx;
		}
		.item-coupon::after {
			content: '张';
			font-size: 16rpx;
			margin-left: 4rpx;
		}
	}
}
</style>
